export default function throttle(fn, interval=500) {
    let firstTime = true,
        _self = fn,
        timer
    return function() {
        if (firstTime) {
            _self.apply(this, arguments)
            return firstTime = false
        }
        if (timer) {
            return false
        }
        timer = setTimeout(function() {
            clearTimeout(timer)
            timer = null
            _self.apply(this, arguments)
        }, interval)
    }
}